39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_analog_in.h"
52#include "drv_i2c_master.h"
74#define THERMOSTAT6_ADC_RESOLUTION 0x0FFF
75#define THERMOSTAT6_VREF_3V3 3.3
76#define THERMOSTAT6_VREF_5V 5.0
77#define THERMOSTAT6_ADC_NUM_SAMPLES_50 50
84#define THERMOSTAT6_SET_DEV_ADDR 0x4D
102#define THERMOSTAT6_MAP_MIKROBUS( cfg, mikrobus ) \
103 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
104 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
105 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
106 cfg.relay = MIKROBUS( mikrobus, MIKROBUS_PWM );
err_t thermostat6_get_adc_v_avg(thermostat6_t *ctx, float *voltage, uint16_t num_samples)
Thermostat 6 get adc voltage average function.
void thermostat6_cfg_setup(thermostat6_cfg_t *cfg)
Thermostat 6 configuration object setup function.
uint8_t thermostat6_get_relay_pin(thermostat6_t *ctx)
Thermostat 6 get relay pin function.
err_t thermostat6_get_an_pin_v(thermostat6_t *ctx, float *voltage)
Thermostat 6 get AN pin voltage function.
err_t thermostat6_get_an_pin_v_avg(thermostat6_t *ctx, float *voltage, uint16_t num_samples)
Thermostat 6 get AN pin voltage function.
float thermostat6_get_temperature(float voltage)
Thermostat 6 get temperature function.
err_t thermostat6_init(thermostat6_t *ctx, thermostat6_cfg_t *cfg)
Thermostat 6 initialization function.
err_t thermostat6_set_vref(thermostat6_t *ctx, float vref)
Thermostat 6 set vref function.
err_t thermostat6_get_adc_v(thermostat6_t *ctx, float *voltage)
Thermostat 6 get adc voltage function.
Thermostat 6 Click configuration object.
Definition thermostat6.h:132
analog_in_resolution_t resolution
Definition thermostat6.h:138
float vref
Definition thermostat6.h:139
uint32_t i2c_speed
Definition thermostat6.h:141
pin_name_t scl
Definition thermostat6.h:134
pin_name_t sda
Definition thermostat6.h:135
pin_name_t relay
Definition thermostat6.h:136
pin_name_t an
Definition thermostat6.h:133
uint8_t i2c_address
Definition thermostat6.h:142
Thermostat 6 Click context object.
Definition thermostat6.h:116
digital_in_t relay
Definition thermostat6.h:117
float vref
Definition thermostat6.h:123
i2c_master_t i2c
Definition thermostat6.h:120
uint8_t slave_address
Definition thermostat6.h:122
analog_in_t adc
Definition thermostat6.h:119
thermostat6_return_value_t
Thermostat 6 Click return value data.
Definition thermostat6.h:151
@ THERMOSTAT6_ERROR
Definition thermostat6.h:153
@ THERMOSTAT6_OK
Definition thermostat6.h:152